/* ============================================================
   TRILHA – CSS UNIFICADO (COM ALTURA FLEXÍVEL)
   ============================================================ */

#tela-trilha {
    background-image: 
        linear-gradient(#1a2a3a 1px, transparent 1px),
        linear-gradient(90deg, #1a2a3a 1px, transparent 1px);
    background-size: 25px 25px;
    background-position: center center;
    background-color: #04070a;
    min-height: 100vh;
    width: 100%;
    padding: 20px 40px;
    box-sizing: border-box;
}

.container-trilha {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.titulo-trilha {
    text-align: center;
    color: #00ff66;
    font-family: 'Courier New', monospace;
    font-size: 1.8rem;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px #00ff66;
}

.trilha-container {
    width: 100%;
}

.botoes-materia {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 10px auto 8px;
}

.btn-materia {
    background: #0a0f18;
    border: 2px solid #2a4a6a;
    color: #7a9aba;
    padding: 10px 24px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.btn-materia.ativo {
    background: #00ff6620;
    border-color: #00ff66;
    color: #00ff66;
    box-shadow: 0 0 15px #00ff6640;
}

.btn-materia:hover {
    background: #00ff6620;
    border-color: #00ff66;
    color: #00ff66;
    transform: translateY(-2px);
}

.cabecalho-materia {
    text-align: center;
    margin: 8px 0 12px;
}

.comando-titulo {
    font-size: 2.2rem;
    font-weight: bold;
    color: #00ff66;
    letter-spacing: 6px;
    text-shadow: 0 0 15px #00ff66;
    font-family: 'Courier New', monospace;
}

.progresso-alvos {
    font-size: 0.7rem;
    color: #ffaa33;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

.botoes-frente {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 8px 0 15px;
}

.btn-frente {
    background: #0a0f18;
    border: 2px solid #2a4a6a;
    color: #7a9aba;
    padding: 8px 22px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.btn-frente.ativo {
    background: #00ff6620;
    border-color: #00ff66;
    color: #00ff66;
    box-shadow: 0 0 15px #00ff6640;
}

.btn-frente:hover {
    background: #00ff6620;
    border-color: #00ff66;
    color: #00ff66;
    transform: translateY(-2px);
}

/* ---------- SCROLL E SVG ---------- */
.zonas-scroll-container {
    overflow-x: auto;
    overflow-y: visible;
    padding: 20px 0 30px;
    scroll-behavior: smooth;
    width: 100%;
    min-height: 600px; /* dá espaço para o SVG crescer */
    scrollbar-width: thin;
    scrollbar-color: #ffaa33 #0a0f18;
}

.zonas-scroll-container::-webkit-scrollbar {
    height: 12px;
}
.zonas-scroll-container::-webkit-scrollbar-track {
    background: #0a0f18;
    border-radius: 10px;
}
.zonas-scroll-container::-webkit-scrollbar-thumb {
    background: #ffaa33;
    border-radius: 10px;
    border: 2px solid #0a0f18;
}
.zonas-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #ffcc44;
}

.zonas-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    align-items: flex-start;
    overflow: visible;
    min-width: min-content;
    width: fit-content;
}

/* ---------- SVG OCUPA TODO O CONTAINER ---------- */
.zonas-container svg {
    display: block;
    width: 100% !important;
    height: auto !important;
    min-height: 500px;
    max-height: 90vh;
}

/* ---------- LEGENDA ---------- */
.mapa-legenda {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
    padding: 12px 20px;
    border-top: 1px solid #1a2a3a;
}

.mapa-legenda div {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
    color: #7a9aba;
}

.legenda-alvo-ativo {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #ffaa33;
    border-radius: 4px;
    box-shadow: 0 0 6px #ffaa33;
}
.legenda-capturado {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #00ff66;
    border-radius: 4px;
}
.legenda-bloqueado {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #2a4a6a;
    border-radius: 4px;
}

/* ---------- SCANNER MODAL ---------- */
#scanner-dossie-final {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: #04070a;
    z-index: 2000;
    opacity: 0;
    transition: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
#scanner-dossie-final.estado-ponto {
    opacity: 1;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff66;
    box-shadow: 0 0 20px #00ff66;
    transition: all 0.2s;
}
#scanner-dossie-final.estado-linha {
    width: 100vw;
    height: 2px;
    border-radius: 0;
    background: #00ff66;
    transition: all 0.25s ease-out;
}
#scanner-dossie-final.estado-tela {
    width: 100vw;
    height: 100vh;
    background: #04070a;
    border: 2px solid #00ff66;
    transition: height 0.3s;
}
#dossie-conteudo-final {
    width: 90%;
    max-width: 500px;
    background: #0a0f18;
    border: 1px solid #2a4a6a;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.1s;
    pointer-events: none;
    font-family: 'Courier New', monospace;
}
#scanner-dossie-final.estado-tela #dossie-conteudo-final {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.dossie-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #2a4a6a;
    padding-bottom: 0.8rem;
    margin-bottom: 1rem;
}
.dossie-header h2 {
    font-size: 1rem;
    color: #fff;
    margin: 0;
    font-family: 'Courier New', monospace;
}
.dossie-tag {
    background: #00ff6620;
    color: #00ff66;
    padding: 2px 8px;
    font-size: 0.7rem;
    border: 1px solid #00ff66;
    font-family: 'Courier New', monospace;
}
.dossie-corpo {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #b0c4de;
    font-family: 'Courier New', monospace;
}
.dossie-metadata {
    font-size: 0.7rem;
    color: #7a9aba;
    margin-top: 0.8rem;
    padding-top: 0.5rem;
    border-top: 1px solid #2a4a6a;
    font-family: 'Courier New', monospace;
}
.dossie-acoes {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #2a4a6a;
}
.btn-dossie-acao,
.btn-dossie-fechar {
    flex: 1;
    padding: 0.6rem;
    background: transparent;
    border: 1px solid;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    text-align: center;
    font-family: 'Courier New', monospace;
}
.btn-dossie-acao {
    border-color: #00ff66;
    color: #00ff66;
}
.btn-dossie-acao:hover {
    background: #00ff66;
    color: #000;
}
.btn-dossie-fechar {
    border-color: #ff4444;
    color: #ff4444;
}
.btn-dossie-fechar:hover {
    background: #ff4444;
    color: #000;
}
.fade-out {
    opacity: 0.2 !important;
    transition: opacity 0.2s ease;
}

/* ---------- MODAL SVG ---------- */
.modal-svg-overlay-custom {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    padding: 20px;
    box-sizing: border-box;
}
.modal-svg-overlay-custom iframe {
    width: 90vw;
    max-width: 800px;
    height: 90vh;
    max-height: 800px;
    border: none;
    background: #0d0d1a;
    pointer-events: none;
}

/* ---------- RESPONSIVO ---------- */
@media (max-width: 768px) {
    #tela-trilha {
        padding: 15px 20px;
    }
    .container-trilha {
        padding: 0 10px;
    }
    .titulo-trilha {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    .comando-titulo {
        font-size: 1.6rem;
        letter-spacing: 3px;
    }
    .btn-materia,
    .btn-frente {
        padding: 6px 14px;
        font-size: 0.7rem;
    }
    .botoes-materia,
    .botoes-frente {
        gap: 6px;
    }
    .zonas-scroll-container {
        min-height: 400px;
        padding: 10px 0 20px;
    }
    .zonas-container svg {
        min-height: 350px;
    }
}